<?php

namespace App\Jobs;

use App\Imports\DomainInduce\Info;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

class ExcelImport implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
     //  $start = microtime(true);
        // $domain_import = new DomainImport;
        //导入数据库     一般
        //  $domain_import->import('upload/excel/工作簿10w.xlsx', 'public');
        //导入数据库     队列
        //  $domain_import->queue('upload/excel/工作簿0w.xlsx', 'public');
        $domain_import = new Info();
      //  $domain_import->queue('upload/excel/import.xlsx', 'public')->allOnQueue('imports');
        $domain_import->queue('upload/excel/import.xlsx', 'public');
      //  $time = microtime(true) - $start;
    }
}
